package com.hxd.otc.dialog;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.flyco.dialog.widget.base.BottomBaseDialog;
import com.hxd.otc.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by lzy on 2018/6/25 0025.
 * description ${保证金说明}
 */
public class MarginStatementDialog extends BottomBaseDialog<MarginStatementDialog> {

    @BindView(R.id.tv_title)
    TextView mTvTitle;
    @BindView(R.id.tv_content)
    TextView mTvContent;

    public MarginStatementDialog(Context context) {
        super(context);
    }

    @Override
    public View onCreateView() {
        return View.inflate(getContext(), R.layout.dialog_margin_statement, null);
    }

    @Override
    public void onViewCreated(View view) {
        ButterKnife.bind(this, view);
    }

    @Override
    public void setUiBeforShow() {
        mTvContent.setText(getContent());
    }

    public String getContent() {
        return new StringBuilder()
                .append(getContext().getString(R.string.dialog1))
                .append("\n\n")
                .append(getContext().getString(R.string.dialog2))
                .append("\n\n")
                .append(getContext().getString(R.string.dialog3))
                .append("\n\n")
                .append(getContext().getString(R.string.dialog4))
                .append("\n\n")
                .append(getContext().getString(R.string.dialog5))
                .toString();
    }

    @OnClick(R.id.iv_close)
    public void onClick() {
        dismiss();
    }
}
